package com.wsk.api.utils;

import com.wsk.api.bean.User;

import java.util.Objects;

/**
 * @DESCRIPTION :
 * @AUTHOR : WuShukai1103
 * @TIME : 2017/12/9  20:21
 */
public class UserUtils {
    public static boolean isEmpty(User user) {
        if (null == user)
            return true;
        if (null == user.getId() || Objects.equals(user.getId().toString(), "") || user.getId().length() < 1) {
            return true;
        }
        if (null == user.getName() || Objects.equals(user.getName().trim(), "") || user.getName().length() < 1) {
            return true;
        }
        if (null == user.getPassword() || Objects.equals(user.getPassword().trim(), "") || user.getPassword().length() < 1) {
            return true;
        }
        if (null == user.getUserEnum() || user.getUserEnum().equals("")) {
            return true;
        }
        return false;
    }
}
